package com.cyy.common.utils;

import java.util.Map;
import java.util.Objects;

public class SelfStringUtils {

    public static String templateStrReplace(Map<String, String> replaceMap, String sourceStr) {

        if (Objects.isNull(replaceMap) || replaceMap.isEmpty()) {
            return sourceStr;
        }

        for (String key : replaceMap.keySet()) {
            sourceStr = sourceStr.replace(key, replaceMap.get(key));
        }

        return sourceStr;
    }
}
